package com.hengxinyongli.iam.web.filter;

import com.alibaba.dubbo.config.annotation.Reference;
import com.hengxinyongli.iam.remote.IamService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.filter.OncePerRequestFilter;

import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author magic
 * @date 2018/9/27/027 16:43
 * @version 1.0
 * Description IamRemoteFilter
 */
public class IamRemoteFilter extends OncePerRequestFilter {

    @Reference
    IamService iamService;

    @Autowired
    RequestAssignment requestAssignment;

    @Override
    protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException {
        requestAssignment.doFilter(request,response,filterChain,iamService);
    }
}
